//
//  CLLeftimageTextField.m
//  togetherLBS
//
//  Created by Phyllis Hu on 15/10/19.
//  Copyright (c) 2015年 celi. All rights reserved.
//

#import "CLLeftimageTextField.h"
#import "UIView+Extension.h"
#import "UIImage+Fit.h"
@implementation CLLeftimageTextField

- (id)initWithFrame:(CGRect)frame leftImage:(NSString*)imageName
{
    self = [super initWithFrame:frame];
    if (self) {
        
        // 设置背景
        self.background = [UIImage resizeImage:@"garyBox"];
        
        // 设置左边显示的图标
        UIImageView *leftView = [[UIImageView alloc] init];
        leftView.image = [UIImage imageNamed:imageName];
        leftView.width = leftView.image.size.width + 20;
        leftView.height = leftView.image.size.height;
        // 设置leftView的内容居中
        leftView.contentMode = UIViewContentModeCenter;
        self.leftView = leftView;
        
        // 设置左边的view永远显示
        self.leftViewMode = UITextFieldViewModeAlways;
    }
    return self;
}


@end
